package com.haixiaoke.saas.repository.mapper;

import com.haixiaoke.saas.repository.pojo.BusinessCircle;
import com.haixiaoke.saas.repository.util.Tree.Node;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 商业区Mapper接口
 *
 * @author haixiaoke
 * @date 2023-04-06
 */
@Mapper
public interface BusinessCircleMapper {
    /**
     * 查询商业区
     *
     * @param businessCircleId 商业区主键
     * @return 商业区
     */
    BusinessCircle selectBusinessCircleByBusinessCircleId(Long businessCircleId);

    /**
     * 查询商业区列表
     *
     * @param businessCircle 商业区
     * @return 商业区集合
     */
    List<BusinessCircle> selectBusinessCircleList(BusinessCircle businessCircle);

    /**
     * 新增商业区
     *
     * @param businessCircle 商业区
     * @return 结果
     */
    int insertBusinessCircle(BusinessCircle businessCircle);

    /**
     * 修改商业区
     *
     * @param businessCircle 商业区
     * @return 结果
     */
    int updateBusinessCircle(BusinessCircle businessCircle);

    /**
     * 删除商业区
     *
     * @param businessCircleId 商业区主键
     * @return 结果
     */
    int deleteBusinessCircleByBusinessCircleId(Long businessCircleId);

    /**
     * 批量删除商业区
     *
     * @param businessCircleIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteBusinessCircleByBusinessCircleIds(Long[] businessCircleIds);

    /**
     * 校验是否有重复的经纬度组合
     * @param longitude  经度
     * @param latitude   纬度
     * @return
     */
    int checkLongitudeAndLatitude(@Param("longitude") BigDecimal longitude,@Param("latitude") BigDecimal latitude);

    /**
     * 根据商业区id进行软删除
     * @param businessCircleIds
     * @return
     */
    int softDeleteBusinessCircleByBusinessCircleIds(Long[] businessCircleIds);

    List<BusinessCircle> selectBusinessCircleByBusinessCircleIdIn(List<Long> businessCircleIdList);

    List<Node> selectComboListByCityId(Long cityId);
}
